---
import type { HTMLAttributes } from 'astro/types'
import Type from './Type.astro'

export interface Props extends HTMLAttributes<'code'> {
	types: string[]
}
const { types, class: cls, ...props } = Astro.props
---

<Type {...props} class:list={[cls, 'leading-snug']}>
	{
		types.map((type, i) => (
			<span
				class:list={[
					'mr-[0.5em] inline-block last:mr-0',
					i !== types.length - 1 && 'border-r-[0.125em] pr-[0.5em]'
				]}
			>
				{type}
			</span>
		))
	}
</Type>
